const parser = require('@babel/parser');
const traverse = require('@babel/traverse').default;
const generate = require('@babel/generator').default;
const types = require('@babel/types');

const sourceCode = `console.log(1);`;

const ast = parser.parse(sourceCode, {
  sourceType: 'unambiguous',
  plugins:[
    "jsx"
  ]
});

traverse(ast, {
    CallExpression(path, state) {
        if(types.isCallExpression(path.node)&& types.isMemberExpression(path.node.callee)&&path.node.callee.object.name==='console'){
            const {line,colums}=path.node.loc
            path.node.arguments.unshift(`[(${line},${colums}):]`)
        }
    }
});

const { code } = generate(ast);
console.log(code);
